package com.gaofei.service.impl;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.gaofei.dao.SpuMapper;
import com.gaofei.domain.Spu;
import com.gaofei.domain.SpuVo;
import com.gaofei.service.SpuService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@Service
public class SpuServiceImpl implements SpuService{

	@Autowired
	SpuMapper spuMapper;
	
	@Override
	public PageInfo<Spu> list(int pageNum, int pageSize, SpuVo vo) {
		PageHelper.startPage(pageNum, pageSize);
		
		return new PageInfo<>(spuMapper.list(vo));
	}

	@Override
	public void delBatch(Integer[] ids) {
		spuMapper.delBatch(ids);		
	}

	@Override
	public void addSpu(Spu spu) {
		spuMapper.addSpu(spu);		
	}

	@Override
	public void update(Spu spu) {
		spuMapper.update(spu);
	}

	@Override
	public Spu findSpuById(Integer spuId) {
		return spuMapper.findSpuById(spuId);
	}
	

}
